package online.shiming.file.util;
import com.alibaba.fastjson.JSON;

import java.util.Map;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class WebSocketCustomEncoding implements Encoder.Text<Map<String, Object>> {


    @Override
    public void init(EndpointConfig endpointConfig) {

    }

    @Override
    public void destroy() {

    }

    @Override
    public String encode(Map<String, Object> stringObjectMap) throws EncodeException {
        return JSON.toJSONString(stringObjectMap);
    }
}